<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
      Schema::create('users', function (Blueprint $table) {
          $table->increments('id');
          $table->string('mobile', 15)->default('')->unique()->comment('手机号');
          $table->string('email',100)->default('')->unique()->comment('邮箱');
          $table->string('real_name', 100)->default('')->comment('真实姓名');
          $table->string('password')->default('')->comment('密码');
          $table->smallInteger('chanel')->default(0)->comment('渠道号');
          $table->string('platform', 50)->default('')->comment('各自平台:ios,web_h5,web_pc,wechat');
          $table->string('device_num')->default('')->comment('设备');
          $table->string('device_info', 2000)->default('')->comment('设备信息');
          $table->tinyInteger('status')->default(1)->comment('状态:0:删除账号，1:正常用户');
          $table->string('avatar')->default('')->comment('头像');
          $table->integer('last_login_time')->default(0)->comment('最后登录时间');
          $table->string('last_login_ip')->default('')->comment('最后登录ip');
          $table->string('token')->default('')->comment('token验证登陆');
          $table->integer('create_time')->default(0)->comment('最后登录时间');
          $table->integer('update_time')->default(0)->comment('最后登录时间');
          
      });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('aixin_users');
    }

}
